package com.springcloud.gateway.provider.fallback;

import com.springcloud.common.core.entity.R;
import com.springcloud.common.core.exception.ApiErrorCode;
import com.springcloud.gateway.provider.AuthProvider;

/**
 * <p>  </p>
 *
 * @author mori
 * @since 11/8/2019 9:14 AM
 */
public class AuthProviderFallback implements AuthProvider {
    /**
     * 降级统一返回无权限
     *
     * @param authentication
     * @param url
     * @param method
     * @return <pre>
     * Result:
     * {
     *   code:"-1"
     *   msg:"系统异常"
     * }
     * </pre>
     */
    @Override
    public R<Boolean> auth(String authentication, String url, String method) {
        return R.failed(ApiErrorCode.FAILED);
    }
}
